package com.example.core;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * 表信息
 */
@Data
public class TableInfo {
    
    /**
     * 表名
     */
    private String tableName;
    
    /**
     * 表注释
     */
    private String comment;
    
    /**
     * 字段列表
     */
    private List<ColumnInfo> columns = new ArrayList<>();
    
    /**
     * 索引列表
     */
    private List<IndexInfo> indexes = new ArrayList<>();
    
    /**
     * 字段信息
     */
    @Data
    public static class ColumnInfo {
        private String columnName;
        private String columnType;
        private Integer length;
        private Integer scale;
        private Boolean nullable;
        private String defaultValue;
        private String comment;
        private Boolean primaryKey;
        private Boolean autoIncrement;
        private Boolean unique = false;
    }
    
    /**
     * 索引信息
     */
    @Data
    public static class IndexInfo {
        private String indexName;
        private String columnName;
        private Boolean unique;
    }
}
